package com.ctg.behavior.utils;

import com.ctg.behavior.api.CtCalcStatus;
import com.ctg.behavior.common.CtgResult;

public class CtStatusUtils {

	public static final void fillStatus(CtgResult ctgResult, CtCalcStatus calcStatus) {
		if (CtCalcStatus.SUCCESS.equals(calcStatus)) {
			ctgResult.setSuccess(true);
		} else {
			ctgResult.setSuccess(false);
		}
		ctgResult.setErrorCode(calcStatus.getCode());
		ctgResult.setErrorMessage(calcStatus.getName());
	}

}
